-- the debug mode
if is_mode("debug") then
    
    -- enable the debug symbols
    set_symbols("debug")

    -- disable optimization
    set_optimize("none")
end

-- the release mode
if is_mode("release") then

    -- set the symbols visibility: hidden
    set_symbols("hidden")

    -- enable fastest optimization
    set_optimize("fastest")

    -- strip all symbols
    set_strip("all")
end

add_packagedirs("../pkg")

-- add target
target("ServerTestTool")

    add_cxflags("-EHsc")
    add_packages("evpp", "gflags", "glog", "event", "spdui")

    -- set kind
    set_kind("binary")

    -- add files
    add_files("src/**.cpp") 

    after_build(function (target)
        os.rm("$(buildir)/lua", "$(buildir)/skin")
        os.cp("$(scriptdir)/src/ui/lua", "$(buildir)/lua")
        os.cp("$(scriptdir)/src/ui/skin", "$(buildir)/skin")
    end)

target_end()

target("TCPPingPongServer")

    add_cxflags("-EHsc")
    add_packages("evpp", "gflags", "glog", "event")

    -- set kind
    set_kind("binary")

    -- add files
    add_files("TCPPingPongServer/*.cpp") 

target_end()